<%@page import="java.util.Date"%>
<%@page import="com.godot.entity.checher.EntityUtil"%>
<%@page import="com.godot.entity.persistent.Godot"%>
<%@page import="com.godot.util.PMF"%>
<%@page import="javax.jdo.PersistenceManager"%>
<%@page import="com.google.appengine.api.datastore.Key"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	Boolean BFlag = (Boolean) session.getAttribute("isLogin");
	boolean flag = false;
	Godot godot = null;
	if (BFlag != null && BFlag) {
		flag = true;
		String key = (String) session.getAttribute("key");
		PersistenceManager pm = PMF.get().getPersistenceManager();
		godot = new EntityUtil(pm).getGodotById(key);
	} else {
		flag = false;
	}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function toAccount() {
	window.location.href = "/godot/account.jsp";
}
</script>
<title>个人主页</title>
</head>
<body>

<%
	if (flag) {
	%>
	<h2 align="center">欢迎<%=godot.getName() %></h2>
	<h3>你的个人信息：</h3>
	<p>
		<span>姓名：<%=godot.getName() %></span><br>
		<span>邮箱：<%=godot.getEmail() %></span><br>
		<span>注册时间：<%=new Date(godot.getCreatTime()) %></span>
	</p>
	<br>
	<input type="button" onclick="toAccount()" value="编辑个人信息">
	<%
	} else {
	%>
	<h2>抱歉，登录失败！</h2>
	<%
	}
%>

</body>
</html>